#pragma once

class CUserStatusDlg : public CDialogImpl<CUserStatusDlg>, public CWinDataExchange<CUserStatusDlg>
{
public:
    enum { IDD = IDD_DIALOG_USER_STATUS };

    BEGIN_MSG_MAP(CUserStatusDlg)
        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
        COMMAND_ID_HANDLER(IDOK, OnOK)
        COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_HANDLER(IDC_BUTTON_CURRENT_TIME, BN_CLICKED, OnBnClickedButtonCurrentTime)
		COMMAND_HANDLER(IDC_BUTTON_CHECK_ID, BN_CLICKED, OnBnClickedButtonCheckId)
		COMMAND_HANDLER(IDC_BUTTON_ADD_RECORD, BN_CLICKED, OnBnClickedButtonAddRecord)
		COMMAND_HANDLER(IDC_BUTTON_DELETE_RECORD, BN_CLICKED, OnBnClickedButtonDeleteRecord)
        COMMAND_HANDLER(IDC_BUTTON_CHOOSE_USER, BN_CLICKED, OnBnClickedButtonChooseUser)
    END_MSG_MAP()


    BEGIN_DDX_MAP(CUserStatusDlg)
		DDX_TEXT(IDC_EDIT_STATUS_NAME, m_strName )
		DDX_TEXT(IDC_EDIT_STATUS_ID, m_strId )
		DDX_FLOAT(IDC_EDIT_STATUS_HEIGHT, m_height)
		DDX_FLOAT(IDC_EDIT_STATUS_WEIGHT, m_weight)
		DDX_FLOAT(IDC_EDIT_STATUS_WAISTLINE, m_waistline)
		DDX_FLOAT(IDC_EDIT_FAT_CONTENT, m_fat_content)
		DDX_FLOAT(IDC_EDIT_BLOOD_PRESSURE, m_blood_pressure)
		DDX_FLOAT(IDC_EDIT_LUNG_CAPACITY, m_lung_capacity)
		DDX_FLOAT(IDC_EDIT_STAIRS_TEST, m_stairs_test)
		DDX_FLOAT(IDC_EDIT_WOLI_TEST, m_woli_test)
		DDX_FLOAT(IDC_EDIT_JUMP_TEST, m_jump_test)
		DDX_FLOAT(IDC_EDIT_SITUP_TEST, m_situp_test)
		DDX_FLOAT(IDC_EDIT_QIANQU_TEST, m_qianqu_test)
		DDX_FLOAT(IDC_EDIT_FIFTY_MILES, m_fifty_miles)
		DDX_CONTROL_HANDLE(IDC_DATETIMEPICKER_TEST_TIME, m_cTime)
		DDX_CONTROL_HANDLE(IDC_LIST_STATUS_RECORD, m_lcStatusRecord)
    END_DDX_MAP()


    LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
    LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

protected:
	CString		m_strId; 
	CString		m_strName;

	float		m_height;
	float		m_weight;
	float		m_waistline;
	float		m_fat_content;
	float		m_blood_pressure;
	float		m_lung_capacity;
	float		m_stairs_test;
	float		m_woli_test;
	float		m_jump_test;
	float		m_situp_test;
	float		m_qianqu_test;
	float		m_fifty_miles;

	CDateTimePickerCtrl m_cTime;

	CListViewCtrl	m_lcStatusRecord;

public:
	LRESULT OnBnClickedButtonCurrentTime(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBnClickedButtonCheckId(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBnClickedButtonAddRecord(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBnClickedButtonDeleteRecord(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
    LRESULT OnBnClickedButtonChooseUser(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};
